package com.codingchili.logging.model;

/**
 * @author Robin Duda
 */
public class LeaderboardEntry {
    private String realm = "unknown";
    private String classId = "unknown";
    private String account = "unknown";
    private String character = "unknown";
    private int experience = 0;
    private int playerLevel = 0;

    public int getExperience() {
        return experience;
    }

    public LeaderboardEntry setExperience(int experience) {
        this.experience = experience;
        return this;
    }

    public int getPlayerLevel() {
        return playerLevel;
    }

    public LeaderboardEntry setPlayerLevel(int playerLevel) {
        this.playerLevel = playerLevel;
        return this;
    }

    public String getRealm() {
        return realm;
    }

    public LeaderboardEntry setRealm(String realm) {
        this.realm = realm;
        return this;
    }

    public String getClassId() {
        return classId;
    }

    public LeaderboardEntry setClassId(String classId) {
        this.classId = classId;
        return this;
    }

    public String getAccount() {
        return account;
    }

    public LeaderboardEntry setAccount(String account) {
        this.account = account;
        return this;
    }

    public String getCharacter() {
        return character;
    }

    public LeaderboardEntry setCharacter(String character) {
        this.character = character;
        return this;
    }

    @Override
    public int hashCode() {
        return String.format("%s.%s", account, character).hashCode();
    }

    @Override
    public boolean equals(Object other) {
        if (other instanceof LeaderboardEntry) {
            return other.hashCode() == hashCode();
        } else {
            return false;
        }
    }
}
